<div class="layui-fluid">
    <div class="layui-card">
      <div class="layui-card-body" style="height:100%;">
          <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
            <legend>公司信息</legend>
          </fieldset>
          <div class="layui-form">
            <table class="layui-table" lay-size="lg">
              <colgroup>
              </colgroup>
              <thead>
                <tr>
                  <th>名称</th>
                  <th>电话</th>
                  <th>联系人姓名</th>
                  <th>地址</th>
                  <th>状态</th>
                  <th>备注</th>
                  <th>时间</th>
                </tr>
              </thead>
              <tbody>
                <tr>
                  <td><?=$info['title']?></td>
                  <td><?=$info['phone']?></td>
                  <td><?=$info['username']?></td>
                  <td><?=$info['address']?></td>
                  <td><?=c("type.status")[$info['status']]?></td>
                  <td><?=$info['note']?></td>
                  <td><?=com_time_format($info['create_time'])?></td>                
                </tr>
              </tbody>
            </table>
          </div>

          <fieldset class="layui-elem-field layui-field-title" style="margin-top: 50px;">
            <legend>列表</legend>
          </fieldset>

          <div class="layui-row layui-form" id="form">
            <div class="layui-col-lg2">
              <input type="hidden" name="id" value="<?=$info['id']?>" >
            </div>
          </div>
          <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
            <ul class="layui-tab-title">
              <li class="layui-tdis layui-this">订单列表</li>
            </ul>
            <div class="layui-tab-content" >
              <div class="layui-tab-item layui-show">
                <table class="layui-hide" lay-filter="table" id="table"></table>
              </div>
            </div>
          </div>
      </div>
    </div>
</div>

<script>
layui
.use(['table','larry'], function(){
    var table = layui.table;
    var $ = layui.$;
    var larry = layui.larry;
    search = function(){
        var url = "/company/company_lists";
        var data = $("#form").find("[name]");
        var where = {};
        data.each(function(i,e){
            where[$(e).attr('name')] = $(e).val();
        });
        table.render({
            elem: '#table'
            ,url:url
            ,where:where
            ,method:'post'
            ,cellMinWidth:180
            ,page: true
            ,cols: [[
                //{type:'checkbox'},
                {field:'id', title: 'ID',width:80, sort: true,title:'ID'}
                ,{field:'name', title: '姓名'}
                ,{field:'phone', title: '电话'}
                ,{field:'age', title: '年龄'}
                ,{field:'sex', title: '性别'}
                ,{field:'address', title: '地址'}
                ,{field:'status', title: '状态'}
                ,{field:'note', title: '备注'}
                ,{field:'create_time', title: '创建时间'}
            ]]
        });
    };
    search();
});
</script>
